import Mock from 'mockjs'

//数据图表
let List = []
export default {
    getStatisticalData: () => {
        // 产生随机数,100~8000,最小0位，最大0位
        for (let i = 0; i < 7; i++) {
            List.push(
                Mock.mock({
                    苹果: Mock.Random.float(100, 8000, 0, 0),
                    vivo: Mock.Random.float(100, 8000, 0, 0),
                    oppo: Mock.Random.float(100, 8000, 0, 0),
                    华为: Mock.Random.float(100, 8000, 0, 0),
                    小米: Mock.Random.float(100, 8000, 0, 0),
                    荣耀: Mock.Random.float(100, 8000, 0, 0)
                })
            )
        }
        return {
            code: 20000,
            data: {
                //饼图
                videoData: [{
                        name: '荣耀',
                        value: 2999
                    },
                    {
                        name: '苹果',
                        value: 5999
                    },
                    {
                        name: 'vivo',
                        value: 1999
                    },
                    {
                        name: 'oppo',
                        value: 2355
                    },
                    {
                        name: '华为',
                        value: 2899
                    },
                    {
                        name: '小米',
                        value: 2200
                    },
                ],
                //柱状图
                userData: [{
                        date: '周一',
                        new: 5,
                        active: 200
                    },
                    {
                        date: '周二',
                        new: 10,
                        active: 100
                    },
                    {
                        date: '周三',
                        new: 12,
                        active: 150
                    },
                    {
                        date: '周四',
                        new: 60,
                        active: 230
                    },
                    {
                        date: '周五',
                        new: 65,
                        active: 250
                    },
                    {
                        date: '周六',
                        new: 43,
                        active: 140
                    },
                    {
                        date: '周天',
                        new: 55,
                        active: 160
                    },
                ],
                //折线图
                orderData: {
                    date: ['20221001', '20221002', '20221003', '20221004', '20221005', '20221006', '20221007'],
                    data: List
                },
                tableData: [{
                        name: 'oppo',
                        todayBuy: 500,
                        monthBuy: 3500,
                        totalBuy: 22000
                    },
                    {
                        name: 'vivo',
                        todayBuy: 400,
                        monthBuy: 2500,
                        totalBuy: 12000
                    },
                    {
                        name: '苹果',
                        todayBuy: 400,
                        monthBuy: 4000,
                        totalBuy: 28000
                    },
                    {
                        name: '小米',
                        todayBuy: 350,
                        monthBuy: 4100,
                        totalBuy: 19000
                    },
                    {
                        name: '华为',
                        todayBuy: 600,
                        monthBuy: 1500,
                        totalBuy: 32000
                    },
                    {
                        name: '荣耀',
                        todayBuy: 500,
                        monthBuy: 2500,
                        totalBuy: 18000
                    },

                ]
            }
        }
    }
}